import Vue from 'vue'
// import 'lib-flexible'
import App from './App.vue'
import router from '@/router'
import store from '@/store'
import 'utils/permission'
import '@/style/common.scss'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import 'style/main.scss'
import BaiduMap from 'vue-baidu-map'
// import VueBMap from 'vue-bmap-gl'
import * as echarts from 'echarts'

Vue.use(BaiduMap, {
  ak: 'uvN6vatvU44OQ0a9yuXdQZxTXODHGuLI&callback'
})

Vue.use(ElementUI)
Vue.config.productionTip = false
Vue.prototype.$echarts = echarts
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

// 适配不同尺寸屏幕（动态计算根元素的大小fonSize）
function resizeCount () {
  const baseConstn = 1920 / 16 // 1920的设计稿 / 基数10
  const nowWidth = document.documentElement.clientWidth
  const nowCount = nowWidth / baseConstn
  document.querySelector('html').style.fontSize = nowCount + 'px'
}
// 初始化
resizeCount()

window.addEventListener('resize', () => {
  resizeCount()
})
